<?php

use app\assets\EchartsAsset;
use app\assets\TableAsset;
use app\assets\LayerAsset;
use app\models\AgentPackage;
use app\models\KeyMap;
use yii\db\Expression;
use yii\helpers\Html;
use yii\helpers\Url;
/**
 * @var $this yii\web\View
 * @var $card app\models\Card
 */

EchartsAsset::register($this);
LayerAsset::register($this);
TableAsset::register($this);

$this->title = '交易退款';
$this->params['breadcrumbs'][] = '财务管理';
$this->params['breadcrumbs'][] = $this->title;
?>
<link rel="stylesheet" href="/assets/layui/css/layui.css">
<style type="text/css">
    th {width: 40%; }
    h4 {color: #CA5952;}
    span {color: red;}
</style>
<form class="layui-form" action="">
<table class="table table-striped table-bordered table-hover" >
        <tr>
            <th colspan="2"><h4>交易信息</h4></th>
        </tr>
    <tr>
        <th>卡号</th>
        <td>1111111</td>
    </tr>
    <tr>
        <th>交易单号</th>
        <td>1111111</td>
    </tr>
    <tr>
        <th>代理商</th>
        <td></td>
    </tr>
    <tr>
        <th>套餐</th>
        <td>飞享大明卡100G</td>
    </tr>
    <tr>
        <th>订单金额</th>
        <td>29.9</td>
    </tr>
    <tr>
        <th>来源</th>
        <td>芒草物联</td>
    </tr>
</table>
<table class="table table-striped table-bordered table-hover" >
    <tr>
        <th colspan="2"><h4>退款方式</h4></th>
    </tr>
    <tr>
        <th style="vertical-align:middle"><span>*</span>退款方式</th>
        <td><input type="radio" name="sex" value="原路退回" title="原路退回" checked></td>
    </tr>
</table>
<table class="table table-striped table-bordered table-hover">
    <tr>
        <th colspan="2"><h4>退款信息</h4></th>
    </tr>
    
    <tr>
        <th style="vertical-align:middle"><span>*</span>退款金额</th>   
        <td><input type="text" name="" placeholder="填写退款金额" autocomplete="off" class="layui-input" lay-verify="required|number"></td>
    </tr>
    <tr>
        <th style="vertical-align:middle"><span>*</span>退款原因</th>
        <td><textarea name="desc" placeholder="退款原因" class="layui-textarea" lay-verify="required"></textarea></td>
    </tr>
</table>


    <div style="text-align:center">
        <button class="layui-btn" lay-submit="" lay-filter="submit"><i class="ace-icon fa fa-check bigger-110"></i>保存</button>
    </div>
    
</form>
<script src="/assets/layui/layui.js"></script>
<script>
layui.use('form', function(){
  var form = layui.form;

  //监听提交
  form.on('submit(submit)', function(data){
					$.ajax({
						url:'/admin/finance/sub-view',
						type:"post",
						data:data.field,
						dataType:"json",
						success:function(data){
							if (data.status==1) {
								var index = parent.layer.getFrameIndex(window.name);//获取窗口索引
								parent.layer.msg(data.info);//父级页面提示成功信息
								parent.location.reload();//刷新父级页面
								parent.layer.close(index);//关闭弹出的子页面窗口
							}else{
								layer.msg(data.info,{anim: 6});//错误提示
							}
						},
					});
					return false;
				});
});
</script>
    				

